﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using ATM.DBlayer;
//using ATM.DBStublayer;

namespace ATM
{
    public class Print_PDF
    {
        public static DataGridView data2 = new DataGridView();
        public static Label lab = new Label();
        public void print_event()
        {
            try
            {

                PrintDocument pd = new PrintDocument();
                pd.DefaultPageSettings.PaperSize = new PaperSize("A4", 800, 1170);
                pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
                pd.Print();

            }
            catch (Exception ex)
            {
                MessageBox.Show("Error", ex.ToString());
            }

        }

        public void pd_PrintPage(object sender, PrintPageEventArgs ev)
        {
            data2 = AccountDB.data;
           




            // inter_face fac = new inter_face("123");
            //  ev.Graphics.PageScale;
            //  ev.HasMorePages(BorderStyle.FixedSingle);    //( Border3DSide.All);
            ev.Graphics.DrawString("Your Bank account details", new Font("Times New Roman", 23, FontStyle.Underline), Brushes.Red, 200, 25);

            ev.Graphics.DrawString("Name :", new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Red, 50, 100);
            ev.Graphics.DrawString(inter_face.name, new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Black, 150, 100);

            ev.Graphics.DrawString("Email :", new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Red, 50, 200);
            ev.Graphics.DrawString(inter_face.email, new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Black, 150, 200);
            //   ev.Graphics.DrawString(event_show.Month + "/", new Font("Times New Roman", 20, FontStyle.Italic), Brushes.Purple, 300,200);
            // ev.Graphics.DrawString(event_show.Year, new Font("Times New Roman", 20, FontStyle.Italic), Brushes.Purple, 350, 200);

            ev.Graphics.DrawString("Account Number : ", new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Red, 50, 300);
            ev.Graphics.DrawString(inter_face.accounN, new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Black, 280, 300);

            ev.Graphics.DrawString("Balance :", new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Red, 50, 400);
            ev.Graphics.DrawString(inter_face.balnce, new Font("Times New Roman", 20, FontStyle.Bold), Brushes.Black, 200, 400);

            ev.Graphics.DrawString("Thanks", new Font("Times New Roman", 20, FontStyle.Italic), Brushes.Red, 500, 500);        
        }
    }
}